import request from '@/config/axios'

// 问诊 VO
export interface ConsultationVO {
  id: number // 问诊id
  pid: number // 患者id
  did: number // 医生id
  status: boolean // 问诊状态
  rating: number // 问诊评分
}

// 问诊 API
export const ConsultationApi = {
  // 查询问诊分页
  getConsultationPage: async (params: any) => {
    return await request.get({ url: `/chat/consultation/page`, params })
  },

  // 查询问诊详情
  getConsultation: async (id: number) => {
    return await request.get({ url: `/chat/consultation/get?id=` + id })
  },

  // 新增问诊
  createConsultation: async (data: ConsultationVO) => {
    return await request.post({ url: `/chat/consultation/create`, data })
  },

  // 修改问诊
  updateConsultation: async (data: ConsultationVO) => {
    return await request.put({ url: `/chat/consultation/update`, data })
  },

  // 删除问诊
  deleteConsultation: async (id: number) => {
    return await request.delete({ url: `/chat/consultation/delete?id=` + id })
  },

  // 导出问诊 Excel
  exportConsultation: async (params) => {
    return await request.download({ url: `/chat/consultation/export-excel`, params })
  },
}